function outcome_mean = cndtl_mean(x_vec, ind_vec, lq, uq)

x_new = x_vec(ind_vec);
lb = quantile(x_new, lq);
ub = quantile(x_new, uq);
x_new = x_new(x_new>=lb & x_new<=ub);
outcome_mean = mean(x_new);
